<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var casts=[
            {name:"张三"},
            {name:"李四"},
            {name:"王五"},
        ];
        // 添加/间隔
        /* var arr=[];
        casts.forEach(ele=>{
            arr.push(ele.name);
        })
        var newArr = arr.join("/");
        console.log(newArr); */
        var str="";
        casts.forEach(ele=>{
            str=str+ele.name+"/";
        })
        console.log(str.length);
        str = str.slice(0,str.length-1);
        console.log(str.length);
        console.log(str);
    </script>
</body>
</html>